<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue 事件处理能力</title>
</head>
<body>
<div id="app">

    <template>
        {{number}}
        <br>
        <button v-on:click="add">增加</button>
        <br>
        <button v-on:click="eventButton">event事件</button>
        <br>
        <input type="number" v-on:keyup.enter="add" v-model="inputValue"/>
    </template>
</div>

<script src="../js/vue.js"></script>
<script>

    const message = {
        number: 0,
        inputValue:0,
    };

    //数据冻结, 禁止调试
    //Object.freeze(message)

    const demo = new Vue({
        el: '#app',
        data: message,
        methods: {
            add: function (){
                this.number += this.inputValue;
            },
            eventButton:function (){
                console.log(this.inputValue)
            }
        },
        computed: {}
    });
</script>
</body>
</html>